<?php

namespace App\Kuafu\Sys\Controller\B;

use App\Kuafu\Base\Controller\BaseController;
use App\Kuafu\Sys\Service\MenusService;
use Illuminate\Http\Request;

class MenusController extends BaseController
{

    /**
     * 查询菜单详情
     *
     * @param Request $request
     * @param int $id
     * @return \Illuminate\Http\JsonResponse
     */
    public function getMenuInfo(Request $request)
    {
        $return = MenusService::getMenuInfo($request);
        return $this->success($return);
    }

    /**
     * 查询菜单列表
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function getMenuList(Request $request)
    {
        $return = MenusService::getMenuList();
        return $this->success($return);
    }


    /**
     * 新增菜单
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function addMenu(Request $request)
    {
        MenusService::addMenu($request);
        return $this->success();
    }

    /**
     * 修改菜单
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function setMenu(Request $request)
    {
        MenusService::setMenu($request);
        return $this->success();
    }

    /**
     * 删除菜单
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function deleteMenu(Request $request)
    {
        MenusService::deletedMenu($request);
        return $this->success();
    }
}
